<?php
$status = I\App::singleton()->getconfig('worktime', 'status');
foreach ($tasks as $listone) {
    $tcolor = tr_color($listone);
    if ($listone->r > 0) {
        $tcolor .= ' rlist';
    }
    ?>
<tr class="<?=$tcolor?>">
<td><input itag="val" name="ids[]" type="checkbox" value="<?=$listone->id?>"></td>

<?php if (isset($related_op) || getgpc('is_related')) {?>
<td>

<div class="btn-group" role="group">
<button type="button" class="btn <?=($listone->status == 98 ? 'btn-success' : 'btn-secondary')?> dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="oi oi-<?=($listone->r > 0 ? 'arrow-thick-bottom' : 'minus')?>"></span>
</button>
<div class="dropdown-menu">
<a class="dropdown-item" href="javascript:ajax('/task/related?related=<?=$listone->id?>&id=0');">取消关联</a>
<?php if ($listone->r > 0): ?>
<a class="dropdown-item" href="javascript:;" onclick="up(this, '/task/rrr/<?=$listone->id?>?updown=up');">上移</a>
<a class="dropdown-item" href="javascript:;" onclick="down(this, '/task/rrr/<?=$listone->id?>?updown=down')">下移</a>
<a class="dropdown-item" href="javascript:ajax('/task/no_r/<?=$listone->id?>/<?=$task->id?>');">取消流程</a>
<?php else: ?>
<a class="dropdown-item" href="javascript:ajax('/task/add_r/<?=$listone->id?>');">加入流程</a>
<?php endif?>
</div>
</div>

</td>
<?php }?>

<td><?=$tags[$listone->tag]->name?></td>
<td><?=$status[$listone->status]?></td>
<td><?=$prioritys[$listone->priority]?>(<?=$listone->level?>)</td>
<td><?=$catys[$listone->caty]->name?></td>

<td class="left">
<p class="list_title">
<a class="<?=$tcolor?>" href="/task/show/<?=$listone->id?>" target="_blank">#<?=$listone->id?> &<?=$tags[$listone->tag]->name?>&<?=$listone->title?> </a>
</p>
</td>

<td><?=$users[$listone->leader]->name?></td>
<td><?=$users[$listone->tester]->name?></td>

</tr>
<?php }?>
<tr><td colspan="12" class="left">
<?php $this->insert('ajax-page')?>
</td></tr>
